 <!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>{$setting.webname}-角色管理</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <link rel="shortcut icon" href="/favicon.ico">
    <link href="/static/admin/css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
    <link href="/static/admin/css/font-awesome.css?v=4.4.0" rel="stylesheet">
    <link href="/static/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="/static/admin/css/animate.css" rel="stylesheet">
    <link href="/static/admin/css/style.css?v=4.1.0" rel="stylesheet">
    <link href="/static/admin/css/plugins/switchery/switchery.css" rel="stylesheet">
    <style>
      .tools a i{
        color:#19a9d5
      }
      .tools a i:hover{
        text-shadow:0px 0px 5px #19a9d5;
      }
        a{
            color:#000 !important;
        }
      .cz a:hover{
          color:#1c84c6 !important;
      }
    </style>

</head>

<body class="gray-bg">
    <div class="row wrapper border-bottom white-bg page-heading">
        <div class="col-sm-4">
            <h2>角色列表</h2>
            <ol class="breadcrumb">
                <li>
                    <a href="{:url('Index/admin')}">主页</a>
                </li>
                <li>
                    <strong>角色管理</strong>
                </li>
            </ol>
        </div>
    </div>
    <div class="wrapper wrapper-content animated fadeInRight">
        <div class="row">
            {foreach $data as $val}
            <div class="col-sm-4">

                <div class="ibox">
                    <div class="ibox-title">
                        <span class="pull-right cz">
                            <a href="{:url('Roles/updates')}?id={$val.r_id}"><i class="fa fa-pencil"></i></a>
                           {if condition="$val.r_name != '校长'&&$val.r_name != '咨询顾问'&&$val.r_name != '咨询主管'"} <a><i class="fa fa-trash del" data-id="{$val.r_id}"></i></a>{/if}
                        </span>
                        <h5>{$val.r_name}</h5>
                    </div>
                    <div class="ibox-content">
                        <div class="team-members">
                            {if condition="!empty($val.user)"}
                                {foreach $val.user as $vals}
                                <img alt="member" class="img-circle" title="{$vals.username}" src="/static/admin/uploads/headphoto/{$vals.photo}">
                                {/foreach}
                            {else /}
                            <img alt="member" class="img-circle" title="无用户" src="/static/admin/uploads/headphoto/none.jpg">
                            {/if}
                        </div>
                        {if condition="$val.parent != ''"}
                            <h4>角色隶属于</h4>
                            <p>
                                {$val.parent}
                            </p>
                        {/if}
                        <h4>角色权限</h4>
                        <p>
                            {$val.jurisdiction2}
                        </p>
                    </div>
                </div>

            </div>
            {/foreach}
        </div>
    </div>

    <!-- 全局js -->
    <script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/admin/js/bootstrap.min.js?v=3.3.6"></script>
    <!-- Peity -->
    <script src="/static/admin/js/plugins/peity/jquery.peity.min.js"></script>
    <!-- Switchery -->
    <script src="/static/admin/js/plugins/switchery/switchery.js"></script>
    <script src="/static/admin/layui/layui.js"></script>
    <script>
        layui.use('layer', function(){ //独立版的layer无需执行这一句
            var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句

            //删除
            $(".del").click(function(){
                var obj = $(this);
                layer.confirm('确定要删除吗？', {
                    btn: ['确定', '取消']
                    ,btn1: function(index, layero){

                        $.post("{:url('Roles/del')}",{id:obj.attr("data-id")},function(data){
                            layer.msg(data.msg,{time:2000},function(){
                                if(data.url){
                                    window.location.href = data.url;
                                }
                            });

                        });
                    }
                });

            });

        });

    </script>
</body>
</html>
